package com.zhny.aiot.xf.weigh.bridge.plugin;

import com.zhny.aiot.plugin.ICenterFacilities;
import com.zhny.aiot.plugin.IDevice;
import com.zhny.aiot.plugin.model.DeviceEntity;
import com.zhny.aiot.plugin.model.FactoryType;
import com.zhny.aiot.plugin.model.StoreEntity;
import com.zhny.aiot.plugin.udc.UdcServer;
import com.zhny.aiot.plugin.udc.device.UdcDeviceFactory;
import com.zhny.aiot.xf.weigh.bridge.plugin.device.WeighBridgeConfig;
import com.zhny.aiot.xf.weigh.bridge.plugin.device.WeighBridgeDevice;
import com.zhny.aiot.xf.weigh.bridge.plugin.model.WeighBridgeStoreEntry;
import org.pf4j.Extension;
import org.pf4j.Plugin;
import org.pf4j.PluginWrapper;

public class WeighBridgePlugin extends Plugin {
    public WeighBridgePlugin(PluginWrapper wrapper) {
        super(wrapper);
    }
    @Extension
    public static class WeighBridfeFactory extends UdcDeviceFactory<WeighBridgeConfig> {
        @Override
        public Class<WeighBridgeConfig> configClass() {
            return WeighBridgeConfig.class;
        }

        public IDevice createDevice(ICenterFacilities iCenterFacilities, DeviceEntity entity) {
            return new WeighBridgeDevice(UdcServer.getInstance ().getEngine () ,this,iCenterFacilities,entity);
        }

        public Class<? extends StoreEntity> storeClass() {
            return WeighBridgeStoreEntry.class;
        }

        public String getId() {
            return "xf-weigh-bridge-plugin";
        }

        public String getName() {
            return "二点万亩息烽地磅插件";
        }

        public FactoryType getType() {
            return FactoryType.Integrate;
        }


    }
}
